let userDao = require("../dao/userDao")

module.exports={
    //登录
    async login(username,pwd){
        return await userDao.getUserByUsernameAndPwd(username,pwd)

    },
    //添加用户
    async addUser(username,pwd){

        let result = await userDao.getUserByUsername(username);
        if(!result){
            return await userDao.insertUser(username,pwd)

        }else{
            return null
        }
       
    }
}